#!/usr/bin/env python
# -*- encoding: utf-8 -*-

def add(a,b):
	return a+b

def sub(a,b):
	return a-b

def mul(a,b):
	return a*b

def div(a,b):
	return a/b

def choose_menu():
	print "What do you want to do?"
	print "add, sub, mul, div, quit"
	return raw_input("You choice : ")

# Key는 연산의 이름, 값은 함수 객체
menu = {'add':add, 'sub':sub, 'mul':mul, 'div':div}
choice = ""

while choice != "quit":
	choice = choose_menu()
	if choice in menu:
		try:
			x = input('first value  : ')
			y = input('second value : ')
		except:
			print "숫자값만 입력하세요!!!\n"
			continue

		print menu[choice](x, y)

